#pragma once

#include <QString>
#include <QDataStream>
#include <QRect>
#include "ObjectPrefab.h"
#include "PrefabRepository.h"

class QPixmap;
class LayoutObject : public QObject
{
	Q_OBJECT
public:
	LayoutObject(void);
	~LayoutObject(void);
public:
	virtual void SerializeTo(QDataStream& ds) const;
	virtual void DeserializeFrom(QDataStream& ds);
public:
	const QString& Name() const { return name_; }
	void SetName(const QString& name) { name_ = name; }

	const QPointF& Position() const { return position_; }
	void SetPosition(const QPointF& position) { position_ = position;	}

	const QPoint& Size() const { return size_; }
	void SetSize(const QPoint& size) { size_ = size; }

	double Orientation() {return orientation_;}
	void setOrientation(double newOrientation) { orientation_ = newOrientation; }

	
	const QString& PrefabGuid() const { return prefabGuid_; }
	void SetPrefabGuid(const QString& prefab) { prefabGuid_ = prefab; }

	ObjectPrefab* Prefab() { return PrefabRepository::Instance()->LookupPrefab(prefabGuid_); }


	//TODO:
signals:
	void ObjectChanged();
private:
	QString name_;
	QPointF position_;
	QPoint size_;
	double orientation_;
	QString prefabGuid_;
};

